package fr.norsys.mapper.console.model;

import java.util.Comparator;

public class ResourceNameComparator implements Comparator {
	
	public int compare(Object o1, Object o2) {
		int result = 0;
		if(o1 instanceof Resource && o2 instanceof Resource) {
			Resource r1 = (Resource) o1;
			Resource r2 = (Resource) o2;
			if(r1.getName()!=null && r2.getName()!=null)
				{result = r1.getName().compareTo(r2.getName());}
		}
		return result; 
	}
}
